public class HumanFactory {
    Human createHuman(String name) throws Exception {
        if (name.equals("male")) {

            return new Male();

        } else if (name.equals("female")) {
            return new Female();
        } else {
            throw new IllegalArgumentException("");
        }
    }

    static Human createMale() {
        return new Male();
    }

    static Human createFemale() {
        return new Female();
    }
}
